xxxxxxxxxx# Reference paper:K Suknuntha, Y Ishii, L Tao, K Hu, BE McIntosh, D Yang, S Swanson, R Stewart, JYJ Wang, J Thomson, I Slukvin. Discovery of survival factor for primitive chronic myeloid leukemia cells using induced pluripotent stem cells. Stem Cell Res 2015. 15(3): 678-693.GEO accession number: GSE60065The original ipynb files can be found at Benno Verbelen (r0301806) in /mnt/storage/r0301806/jupyternotebooksAll resulting data obtained or produced during this assignment can be found at the following locations: /mnt/storage/r0301806/RNAseqgroepswerk/ (Benno Verbelen)/mnt/storage/r0304814/RNAseqgroepswerk/ (Ruben Weckx)/mnt/storage/r0304814/chip/ (Ruben Weckx)# IntroductionChronic myeloid leukemia (CML) originates in hematopoietic stem cells (HSC) within the bone marrow by a chromosomal t(9;22)(q34;q11.2) translocation, known as the Philadelphia translocation. This causes the constitutive expression of the oncogenic BCR-ABL fusion protein, a serine/threonine and tyrosine kinase. Tyrosine kinase inhibitors (TKI), like imatinib, have previously been found to induce complete cytogenetic response in most patients, however relapse of the disease is commonly seen when TKI treatment is discontinued. It was suggested that HSCs could carry leukemic stem cell (LSC) features, including innate resistance to TKI therapy. Therefore, research of primitive LSCs is needed for a better understanding of CML pathogenesis, as well as therapeutic strategies of the disease. Human somatic induced pluripotent stem cells (iPSCs) were generated and used as a model for primitive HSCs. iPSCs could also be generated from primary CML cells. Subsequently, these iPSCs were differentiated back into blood cells, resulting in unlimited production of primitive HSC carrying LCS features. CML LSCs were derived from a patient with CML in chronic phase and remodeled into iPSCs (CML15 iPSCs and CML17 iPSCs). Bone-marrow (BM) derived iPSCs (BM1K and BM9) were used as control. CML and control iPSCs were pushed towards becoming CML iPSC-derived lin-CD34+CD90+CD117+CD45+38+/−, referred to as induced CD34+ cells (iCD34+).Two different conditions were tested for BM and CML samples: BM1K iCD34+ untreatedBM9 iCD34+ untreatedCML15 iCD34+ untreatedCML17 iCD34+ untreatedBM1K iCD34+ treated with imatinibBM9 iCD34+ treated with imatinibCML15 iCD34+ treated with imatinibCML17 iCD34+ treated with imatinib # ResultsFor our project we will look for genes that have altered expression levels in CML samples after imatinib treatment, which is not seen in healthy BM samples. We uploaded our dataset from the GEO browser in order to perform RNAseq analysis (as was done in the article). We first performed a quality control (QC) regarding our data. No unexpected abnormalities were found (fastqc.html-files). Afterwards, all sequences were mapped (STAR), aligned (sam-files), compressed, sorted and indexed (bam-files). Next, by using the idxstats command from samtools we showed the number of mapped reads per chromosome. Via flagstat, we looked at the QC-passed and -failed reads. The output showed no QC-failed reads, which confirms good quality of our initial samples. The number of reads per gene were counted using the featureCounts command and stored in the output file for BM (/mnt/storage/r0304814/RNAseqgroepswerk/all.CMLcounts1)) and CML samples (/mnt/storage/r0301806/RNAseqgroepswerk/all.CMLcounts2). To look at the gene expression levels, we first converted this file to an excel-accessible file (tsv-file). We now wanted to calculate the log2 fold change for bone marrow and CML tissue samples, via differential expression sequence analysis. We looked for candidate genes which could provide imatinib resistance in CML cells. In the article they mention their inclusion and exclusion criteria: “From the list of upregulated genes, we chose 137 that were induced ≥2 fold by imatinib treatment (…). Then, we selected genes that were upregulated in CML iCD34+ cells, but suppressed in BM iCD34+ cells (…). A similar algorithm was applied for down-regulated genes. From the list of significantly downregulated genes, we chose those that were suppressed ≥2 fold by imatinib in CML iCD34+ (16 genes). We then selected genes that were suppressed in CML iCD34+ cells, but upregulated in BM iCD34+ cells (…).” In BM samples 618 genes were upregulated and 762 were downregulated. For CML samples 200 genes were upregulated and 39 were downregulated. We applied the same criteria to our resulting dataset, leaving us with 133 upregulated genes and 39 downregulated genes associated with imatinib treatment for CML samples. In the article, BCL2A1, ALOX15 and SMAD7 were found to be upregulated. In addition, their research showed OLFM4 to be the top-ranking upregulated gene. However, according to their criteria, our results excluded these genes from the list of candidate target genes i.e. a gene upregulated in CML samples, but downregulated in BM samples and vice versa. The researchers of this article used EBseq(v.1.1.6) software (http://www.biostat.wisc.edu/~kendzior/EBSEQ/). We performed all our calculations as taught in class, this was the only difference between our conduct of work. We tried to reproduce their results by using the same software they used, but we were unable to do so due to technical difficulties. We continued with our data.We then ran our data in GSEA. A ranked file (.rnk) was made, which consisted of 2 columns (gene symbols, expression score). KEGG was used as the gene set database. As a control we looked at the hematopoietic cell lineage enrichment for the CML samples, which showed that a number of upregulated genes were positively correlated with differentiation of precursor bone marrow cells to the hematopoietic cell lineage. This can be explained by the concept of CML, an overproduction of white blood cells. We also looked at cell cycle enrichment in CML samples and showed an enrichment at the negative side, meaning that downregulated genes are involved in the cell cycle. K Suknuntha, Y Ishii, L Tao, K Hu, BE McIntosh, D Yang, S Swanson, R Stewart, JYJ Wang, J Thomson, I Slukvin. Discovery of survival factor for primitive chronic myeloid leukemia cells using induced pluripotent stem cells. Stem Cell Res 2015. 15(3): 678-693.
GEO accession number: GSE60065
The original ipynb files can be found at Benno Verbelen (r0301806) in /mnt/storage/r0301806/jupyternotebooks
All resulting data obtained or produced during this assignment can be found at the following locations: /mnt/storage/r0301806/RNAseqgroepswerk/ (Benno Verbelen) /mnt/storage/r0304814/RNAseqgroepswerk/ (Ruben Weckx) /mnt/storage/r0304814/chip/ (Ruben Weckx)
Chronic myeloid leukemia (CML) originates in hematopoietic stem cells (HSC) within the bone marrow by a chromosomal t(9;22)(q34;q11.2) translocation, known as the Philadelphia translocation. This causes the constitutive expression of the oncogenic BCR-ABL fusion protein, a serine/threonine and tyrosine kinase. Tyrosine kinase inhibitors (TKI), like imatinib, have previously been found to induce complete cytogenetic response in most patients, however relapse of the disease is commonly seen when TKI treatment is discontinued. It was suggested that HSCs could carry leukemic stem cell (LSC) features, including innate resistance to TKI therapy. Therefore, research of primitive LSCs is needed for a better understanding of CML pathogenesis, as well as therapeutic strategies of the disease. Human somatic induced pluripotent stem cells (iPSCs) were generated and used as a model for primitive HSCs. iPSCs could also be generated from primary CML cells. Subsequently, these iPSCs were differentiated back into blood cells, resulting in unlimited production of primitive HSC carrying LCS features. CML LSCs were derived from a patient with CML in chronic phase and remodeled into iPSCs (CML15 iPSCs and CML17 iPSCs). Bone-marrow (BM) derived iPSCs (BM1K and BM9) were used as control. CML and control iPSCs were pushed towards becoming CML iPSC-derived lin-CD34+CD90+CD117+CD45+38+/−, referred to as induced CD34+ cells (iCD34+). Two different conditions were tested for BM and CML samples:
BM1K iCD34+ untreated BM9 iCD34+ untreated CML15 iCD34+ untreated CML17 iCD34+ untreated BM1K iCD34+ treated with imatinib BM9 iCD34+ treated with imatinib CML15 iCD34+ treated with imatinib CML17 iCD34+ treated with imatinib
For our project we will look for genes that have altered expression levels in CML samples after imatinib treatment, which is not seen in healthy BM samples.
We uploaded our dataset from the GEO browser in order to perform
RNAseq analysis (as was done in the article). We first performed a
quality control (QC) regarding our data. No unexpected abnormalities
were found (fastqc.html-files). Afterwards, all sequences were mapped
(STAR), aligned (sam-files), compressed, sorted and indexed (bam-files).
Next, by using the idxstats command from samtools we showed the number
of mapped reads per chromosome. Via flagstat, we looked at the QC-passed
and -failed reads. The output showed no QC-failed reads, which confirms
good quality of our initial samples. The number of reads per gene were
counted using the featureCounts command and stored in the output file
for BM (/mnt/storage/r0304814/RNAseqgroepswerk/all.CMLcounts1)) and CML
samples (/mnt/storage/r0301806/RNAseqgroepswerk/all.CMLcounts2). To look
at the gene expression levels, we first converted this file to an
excel-accessible file (tsv-file).
We now wanted to calculate the log2 fold change for bone marrow and CML
tissue samples, via differential expression sequence analysis. We looked
for candidate genes which could provide imatinib resistance in CML
cells. In the article they mention their inclusion and exclusion
criteria:
“From the list of upregulated genes, we chose 137 that were induced ≥2
fold by imatinib treatment (…). Then, we selected genes that were
upregulated in CML iCD34+ cells, but suppressed in BM iCD34+ cells (…). A
similar algorithm was applied for down-regulated genes. From the list
of significantly downregulated genes, we chose those that were
suppressed ≥2 fold by imatinib in CML iCD34+ (16 genes). We then
selected genes that were suppressed in CML iCD34+ cells, but upregulated
in BM iCD34+ cells (…).”
In BM samples 618 genes were upregulated
and 762 were downregulated. For CML samples 200 genes were upregulated
and 39 were downregulated. We applied the same criteria to our resulting
dataset, leaving us with 133 upregulated genes and 39 downregulated
genes associated with imatinib treatment for CML samples. In the
article, BCL2A1, ALOX15 and SMAD7 were found to be upregulated. In
addition, their research showed OLFM4 to be the top-ranking upregulated
gene. However, according to their criteria, our results excluded these
genes from the list of candidate target genes i.e. a gene upregulated in
CML samples, but downregulated in BM samples and vice versa. The
researchers of this article used EBseq(v.1.1.6) software (http://www.biostat.wisc.edu/~kendzior/EBSEQ/).
We performed all our calculations as taught in class, this was the only
difference between our conduct of work. We tried to reproduce their
results by using the same software they used, but we were unable to do
so due to technical difficulties. We continued with our data.
We then ran our data in GSEA. A ranked file (.rnk) was made, which consisted of 2 columns (gene symbols, expression score). KEGG was used as the gene set database. As a control we looked at the hematopoietic cell lineage enrichment for the CML samples, which showed that a number of upregulated genes were positively correlated with differentiation of precursor bone marrow cells to the hematopoietic cell lineage. This can be explained by the concept of CML, an overproduction of white blood cells. We also looked at cell cycle enrichment in CML samples and showed an enrichment at the negative side, meaning that downregulated genes are involved in the cell cycle.
<img width="50%" src="/user/r0301806/files/GSEAlineage.jpg"><img width="50%" src="/user/r0301806/files/GSEAcycle.jpg">

Furthermore, we ran our list of up- and downregulated genes to the background list of all genes generated by RNAseq in GOrilla (http://cbl-gorilla.cs.technion.ac.il/GOrilla/shmnv4uj/GOResults.html). These genes were significantly involved in the following processes which we considered to be associated with CML: Regulation of apoptotic processes, positive regulation of macrophage chemotaxis, positive regulation of Ras protein signal transduction, … . Furthermore, we ran our list of up- and downregulated genes to the background list of all genes generated by RNAseq in GOrilla (http://cbl-gorilla.cs.technion.ac.il/GOrilla/shmnv4uj/GOResults.html). These genes were significantly involved in the following processes which we considered to be associated with CML: Regulation of apoptotic processes, positive regulation of macrophage chemotaxis, positive regulation of Ras protein signal transduction, … .
<img width="80%" src="/user/r0301806/files/GOrilla.jpg">
xxxxxxxxxxTo visualize the changes in gene expression due to imatinib (the 133 upregulated genes and 39 downregulated genes), we generated a heat map using the Multi-Experiment Viewer tool. (only a part of the heat map is shown in the figure)To visualize the changes in gene expression due to imatinib (the 133 upregulated genes and 39 downregulated genes), we generated a heat map using the Multi-Experiment Viewer tool. (only a part of the heat map is shown in the figure)
<img width="90%" src="/user/r0301806/files/HeatMap2.jpg">
Subsequently, we predicted possible regulators and targets of the transcription factor within our set of genes via the Cytoscape iRegulon application. For the upregulated genes, PITX3 had the highest NES score of 4.007 (closely followed by BRCA1 and MYBL2). The transcription factor SRF had the highest NES score of 5.656 for the downregulated genes (followed by SIN3A and HOXA3). Subsequently, we predicted possible regulators and targets of the transcription factor within our set of genes via the Cytoscape iRegulon application. For the upregulated genes, PITX3 had the highest NES score of 4.007 (closely followed by BRCA1 and MYBL2). The transcription factor SRF had the highest NES score of 5.656 for the downregulated genes (followed by SIN3A and HOXA3).
<img width="30%" src="/user/r0301806/files/PITX3.jpg"> <img width="30%" src="/user/r0301806/files/SRF.jpg">

xxxxxxxxxxLastly, the most enriched motives for these two transcription factors were discovered. Transfec_public-M00021 and tiapale-NNMCCATATAWGGKNN-SRF-full for PITX3 and SRF respectively.Lastly, the most enriched motives for these two transcription factors were discovered. Transfec_public-M00021 and tiapale-NNMCCATATAWGGKNN-SRF-full for PITX3 and SRF respectively.
<img width="30%" src="/user/r0301806/files/PITX3motive.jpg">
<img width="30%" src="/user/r0301806/files/SRFmotive.jpg">
xxxxxxxxxx# ChIPseqWe went to ChIP-Atlas to look for ChIPseq data concerning PITX3 and SRF. Apparently, no ChIPseq studies are conducted for PITX3. Therefore, we looked at studies done on BRCA1 and MYBL2 but came to the conclusion that none of our upregulated target genes generated by iRegulon were listed as potential target genes for BRCA1 or MYBL2 in any of the studies. However, available SRF ChIPseq studies did mention some of our target downregulated genes (EGR1, FOS, DUSP2) as potential target genes. We therefore decided to only analyze ChIP data for SRF. The most relevant study available used blood cells as cell type (GSM803350). However, they did not analyze any cancerous cells nor did they apply any particular treatment or protocols to their samples. The files containing the narrowpeaks (bed-files) were obtained using the bowtie2 command. The generated reads and the peaks were uploaded in igv. We looked at the above mentioned downregulated genes which are potential targets for SRF. The goal of the ChIPseq was to find peaks in the promotor regions targeted genes involved in imatinib resistance. And indeed, Peaks were found in the promotor regions of all three genes (EGR1, FOS and DUSP2 respectively, as seen in the figures below). This confirms our hypothesis that SRF affects the expression of these three genes. We went to ChIP-Atlas to look for ChIPseq data concerning PITX3 and SRF. Apparently, no ChIPseq studies are conducted for PITX3. Therefore, we looked at BRCA1 and MYBL2 and came to the conclusion that none of our upregulated target genes generated by iRegulon were listed as potential target genes for BRCA1 or MYBL2. However, SRF ChIPseq studies did exist, mentioning some of our target downregulated genes (EGR1, FOS, DUSP2). We therefore decided to only analyze ChIP data for SRF. The most relevant study available used blood cells as cell type (GSM803350). However, they did not analyze any cancerous cells nor did they apply any particular treatment or protocols. The files containing the narrowpeaks (bed-files) were obtained using the bowtie2 command. The generated reads and the peaks were uploaded in igv. We looked at the above mentioned downregulated genes which are potential targets for SRF. The goal of the ChIPseq was to find peaks in the targeted genes involved in imatinib resistance. Peaks were found in the promotor regions of all three genes (EGR1, FOS and DUSP2 respectively as seen in the figures below). This confirms our hypothesis that SRF affects the expression of these three genes.
<img width="50%" src="/user/r0301806/files/EGR1igv.jpg"><img width="50%" src="/user/r0301806/files/FOSigv.jpg"><img width="50%" src="/user/r0301806/files/DUSP2igv.jpg">

xxxxxxxxxx# DiscussionAfter analysis of our data we found possible target genes involved in imatinib resistance in treatment of CML. After comparison with the article, however, we did not find OLFM4, ALOX15, BCL2A1 and SMAD7 to be conform with their inclusion criteria. In other words, these genes did not have a significantly altered expression, so were not included in our analysis. Nonetheless, we continued with our data, which consisted of 133 upregulated and 39 downregulated genes. Based upon these genes, we predicted the transcription factors (and their associated motif) which are involved in the regulation of these target genes. For all significantly upregulated genes, PITX3 emerged as the most enriched transcription factor. For all significantly downregulated genes, SRF was predicted to be the most promising transcription factor. ChIPseq studies were not available for PITX3. Since BRCA1 and MYBL2 did not show possible target genes identical to our own upregulated target genes, we were not able to run a ChIPseq on these transcription factors. But, we were able to run a ChIPseq on SRF, because studies did show three genes matching with our own downregulated genes. The promotor regions of these genes had a high coverage. This implies that they could be used as a possible target for therapy for patients with an imatinib restistant CML profile.After analysis of our data we found possible target genes involved in imatinib resistance in treatment of CML. After comparison with the article, however, we did not find OLFM4, ALOX15, BCL2A1 and SMAD7 to be conform with their inclusion criteria. In other words, these genes did not have a significantly altered expression, so were not included in our analysis. Nonetheless, we continued with our data, which consisted of 133 upregulated and 39 downregulated genes. Based upon these genes, we predicted the transcription factors (and their associated motif) which are involved in the regulation of these target genes. For all significantly upregulated genes, PITX3 emerged as the most enriched transcription factor. For all significantly downregulated genes, SRF was predicted to be the most promising transcription factor. ChIPseq studies were not available for PITX3. Since BRCA1 and MYBL2 did not show possible target genes identical to our own upregulated target genes, we were not able to run a ChIPseq on these transcription factors. But, we were able to run a ChIPseq on SRF, because studies did show three genes matching with our own downregulated genes. The promotor regions of these genes had a high coverage. This implies that they could be used as a possible target for therapy for patients with an imatinib restistant CML profile.
pwdmkdir /home/luna.kuleuven.be/r0301806/data/ncbicd /home/luna.kuleuven.be/r0301806/data/workpwd# To convert our sra sample data link from GEO to fastq files, we need to use the sra toolkit.# But first, this toolkit needs a cache directory (which cannot be the home directory!), so we create one: vdb-config -s /repository/user/main/public/root=~/data/ncbi# Now we can use the sra toolkit. mkdir /home/luna.kuleuven.be/r0301806/data/workcd /home/luna.kuleuven.be/r0301806/data/worklsfastq-dump --split-files SRR1536061fastq-dump --split-files SRR1536062fastq-dump --split-files SRR1536063fastq-dump --split-files SRR1536064fastq-dump --split-files SRR1536065fastq-dump --split-files SRR1536066fastq-dump --split-files SRR1536067fastq-dump --split-files SRR1536068# Give the fastq files another name, which is more recognizablemv SRR1536061_1.fastq BM1KiCD34ctrl.fastqmv SRR1536062_1.fastq BM9iCD34ctrl.fastqmv SRR1536063_1.fastq CML15iCD34ctrl.fastqmv SRR1536064_1.fastq CML17iCD34ctrl.fastqmv SRR1536065_1.fastq BM1KiCD34Imatinib.fastqmv SRR1536066_1.fastq BM9iCD34Imatinib.fastqmv SRR1536067_1.fastq CML15iCD34Imatinib.fastqmv SRR1536068_1.fastq CML17iCD34Imatinib.fastqlsmkdir -p /home/luna.kuleuven.be/r0301806/data/RNAseqgroepswerkcd ~/data/RNAseqgroepswerkpwd# Create a symbolic (-s) link to the fastq files in your RNAseqgroepswerk directory, by using the ln command.# -f : remove existing destination filesln -sf /mnt/nfs/r0301806/work/*.fastq ~/data/RNAseqgroepswerk/ls -l# Produce a quality analysis report of the fastq files: /usr/local/bin/FastQC/fastqc -o . BM1KiCD34ctrl.fastq/usr/local/bin/FastQC/fastqc -o . BM9iCD34ctrl.fastq/usr/local/bin/FastQC/fastqc -o . CML15iCD34ctrl.fastq/usr/local/bin/FastQC/fastqc -o . CML17iCD34ctrl.fastq/usr/local/bin/FastQC/fastqc -o . BM1KiCD34Imatinib.fastq/usr/local/bin/FastQC/fastqc -o . BM9iCD34Imatinib.fastq/usr/local/bin/FastQC/fastqc -o . CML15iCD34Imatinib.fastq/usr/local/bin/FastQC/fastqc -o . CML17iCD34Imatinib.fastqSTAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn BM1KiCD34ctrl.fastq \ --outFileNamePrefix BM1KiCD34ctrl.STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn BM9iCD34ctrl.fastq \ --outFileNamePrefix BM9iCD34ctrl.STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn CML15iCD34ctrl.fastq \ --outFileNamePrefix CML15iCD34ctrl.STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn CML17iCD34ctrl.fastq \ --outFileNamePrefix CML17iCD34ctrl.STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn BM1KiCD34Imatinib.fastq \ --outFileNamePrefix BM1KiCD34Imatinib.STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn BM9iCD34Imatinib.fastq \ --outFileNamePrefix BM9iCD34Imatinib.STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn CML15iCD34Imatinib.fastq \ --outFileNamePrefix CML15iCD34Imatinib.STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \ --genomeLoad LoadAndKeep \ --runThreadN 2 \ --readFilesIn CML17iCD34Imatinib.fastq \ --outFileNamePrefix CML17iCD34Imatinib.ls -l# SAM file structure:# A SAM file is a text file containing the alignment of all reads. # SAM files start with a header:(Please do not use `cat` as this will crash your notebook!!)head -40 BM1KiCD34Imatinib.Aligned.out.sam | grep -v '^@'# SAM files are unsorted and uncompressed. To solve this, we will sort the SAM files and convert them to a BAM file.# This BAM file is a smaller / more compressed version of the SAM file.# Afterwards we will create an index for quick access. We will use samtools to do this. # In the first step we will sort and output BAM files: samtools sort -o BM1KiCD34ctrl.bam BM1KiCD34ctrl.Aligned.out.samsamtools index BM1KiCD34ctrl.bamsamtools sort -o BM9iCD34ctrl.bam BM9iCD34ctrl.Aligned.out.samsamtools index BM9iCD34ctrl.bamsamtools sort -o CML15iCD34ctrl.bam CML15iCD34ctrl.Aligned.out.samsamtools index CML15iCD34ctrl.bamsamtools sort -o CML17iCD34ctrl.bam CML17iCD34ctrl.Aligned.out.samsamtools index CML17iCD34ctrl.bamsamtools sort -o BM1KiCD34Imatinib.bam BM1KiCD34Imatinib.Aligned.out.samsamtools index BM1KiCD34Imatinib.bamsamtools sort -o BM9iCD34Imatinib.bam BM9iCD34Imatinib.Aligned.out.samsamtools index BM9iCD34Imatinib.bamsamtools sort -o CML15iCD34Imatinib.bam CML15iCD34Imatinib.Aligned.out.samsamtools index CML15iCD34Imatinib.bamsamtools sort -o CML17iCD34Imatinib.bam CML17iCD34Imatinib.Aligned.out.samsamtools index CML17iCD34Imatinib.bamls -l# Inspecting the BAM files:ls -l *.ba[mi]# If we look at one of them (via head!! Otherwise it will crash), we can see some of the aligned reads:samtools view BM1KiCD34ctrl.bam | head -3# The format of the BAM output is the same as that of the SAM output.# Via idxstats you can see how many reads map to each chromosome:# 4 columns: the reference sequence name, the sequence length, the number of mapped reads and number of unmapped readssamtools idxstats BM1KiCD34ctrl.bamsamtools idxstats BM1KiCD34Imatinib.bamsamtools idxstats BM9iCD34ctrl.bamsamtools idxstats BM9iCD34Imatinib.bamsamtools idxstats CML15iCD34ctrl.bamsamtools idxstats CML15iCD34Imatinib.bamsamtools idxstats CML17iCD34ctrl.bamsamtools idxstats CML17iCD34Imatinib.bam# Running samtools flagstat tells us what the distribution of mapping flags (column 2 in the sam/bam file) is:# 0x0001 p the read is paired in sequencing# 0x0002 P the read is mapped in a proper pair# 0x0004 u the query sequence itself is unmapped# 0x0008 U the mate is unmapped# 0x0010 r strand of the query (1 for reverse)# 0x0020 R strand of the mate# 0x0040 1 the read is the first read in a pair# 0x0080 2 the read is the second read in a pair# 0x0100 s the alignment is not primary# 0x0200 f the read fails platform/vendor quality checks# 0x0400 d the read is either a PCR or an optical duplicate# 0x0800 S the alignment is supplementary# info : http://www.htslib.org/doc/samtools.htmlsamtools flagstat BM1KiCD34ctrl.bamsamtools flagstat BM1KiCD34Imatinib.bamsamtools flagstat BM9iCD34ctrl.bamsamtools flagstat BM9iCD34Imatinib.bamsamtools flagstat CML15iCD34ctrl.bamsamtools flagstat CML15iCD34Imatinib.bamsamtools flagstat CML17iCD34ctrl.bamsamtools flagstat CML17iCD34Imatinib.bam# reads to gene counts: # First we'll make a symbolic link to (a part of!) the human annotation.ln -sf /mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtfls -l *gtfhead -3 gencode.v19.nopseudo.plus.sort.gtffeatureCounts --helpcd /mnt/storage/r0301806/RNAseqgroepswerk# featureCounts = read summarization program that counts mapped reads for genomic features such as genes, exons, # promoter, gene bodies, genomic bins and chromosomal locations. It can be used to count both RNA-seq and # genomic DNA-seq reads. # -Q: The minimum mapping quality score (10) # -g: gene name # -a: name of the annotation file (gtf) # -o: output file name featureCounts \ -Q 10 \ -g gene_name \ -a /mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtf \ -o all.CMLcounts2 \ CML15iCD34ctrl.bam CML15iCD34Imatinib.bam CML17iCD34ctrl.bam CML17iCD34Imatinib.bam # Note: This was also done for bone marrow bam files! (/mnt/storage/r0304814/RNAseqgroepswerk)ls -l *.CMLcounts*head -20 all.CMLcounts2.summary | column -thead all.CMLcounts2cut -f-6 all.CMLcounts2 > all.genedataCML2.tsvhead all.genedataCML2.tsvcut -f1,7- all.CMLcounts2 | grep -v '^#' > all.geneCML.counts2.tsvhead -50 all.geneCML.counts2.tsv# Because OLFM4 was mentioned as upregulated gene in the article, we did a quick check.grep OLFM4 all.geneCML.counts2.tsv## (The DESeq code in R can be found in the addendum)cut -f1,3 deseq.CML1results.tsv > deseqcut.rnk # bone marrow samplescut -f1,3 deseq2.CMLresults.tsv > deseq2cut.rnk # CML samplessed 1d deseqcut.rnk > deseqcutbm.rnksed 1d deseq2cut.rnk > deseqcutcml.rnkgrep -v "NA" deseqcutbm.rnk > deseqcutcleanbm.rnkgrep -v "NA" deseqcutcml.rnk > deseqcutcleancml.rnk# files are now compatible to be uploaded in GSEA.mkdir -p /mnt/nfs/r0301806/RNAseqgroepswerk/SMAD7/cd /mnt/nfs/r0301806/RNAseqgroepswerk/SMAD7/ln -sf /mnt/nfs/storage/r0301806/RNAseqgroepswerk/*.fastq .# Now we align our reads to the human genome:cd /mnt/nfs/r0301806/RNAseqgroepswerk/SMAD7/bowtie2-align -x /mnt/nfs/data/resources/bowtie2/hg19 chipseq1.fastq -S chipseq1.sambowtie2-align -x /mnt/nfs/data/resources/bowtie2/hg19 chipseq2.fastq -S chipseq2.samsamtools view -S -b chipseq1.sam > chipseq1.bamsamtools view -S -b chipseq2.sam > chipseq2.bamsamtools sort -O bam -o chipseq1.sorted.bam chipseq1.bam samtools sort -O bam -o chipseq2.sorted.bam chipseq2.bam samtools index chipseq1.sorted.bam samtools index chipseq2.sorted.bammkdir -p mymacs2# we want to call peaks to the entire genome (-g hs) with a minimum FDR (q-value) cutoff for peak detection of 0.005:macs2 callpeak -t chipseq1.sorted.bam --outdir mymacs2 -n chipseq1 -g hs -q 0.005macs2 callpeak -t chipseq2.sorted.bam --outdir mymacs2 -n chipseq2 -g hs -q 0.005wc -l mymacs2_SMAD7/BM1Kctrl_SMAD7_peaks.narrowPeakwc -l mymacs2_SMAD7/BM1Kimatinib_SMAD7_peaks.narrowPeak